<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <script>

    // 立即执行函数
    (function aa(params) {
      console.log("立即执行函数" + params);
    })(123)

    // 函数声明式 可以先调用后声明
    function sayHello(params) {
      function hi() {
        console.log("hi " + params);
      }
      return hi
    }
    var fn = sayHello("kobe")
    fn()

    // 必须先声明函数 才可以调用
    var fn1 = function(params) {
      console.log("函数表达式" + params);
    }
    fn1()

    var a = 30
    var b = 40
    var c = a ** b
    console.log(c);

    function sumn(n) {
      
      console.log(arguments);
      console.log(typeof arguments);

      var total = 0
      for (var i = 0; i < n; i++) {
        total+=i
      }
      return total
    }
    console.log(sumn(4))
  </script>
</body>
</html>